package com.tinem.platform.module.starter.jpa.repository.pay;

import com.tinem.platform.module.starter.jpa.entity.pay.OrderPayVirtual;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Optional;

/**
 * @author fzh
 * @version v1
 * @program: platform
 * @className OrderPayRepository
 * @description TODO
 * @site 
 * @company 
 * @create 2020-09-01 13:41:09
 */
@Repository
public interface OrderPayVirtualRepository extends JpaRepository<OrderPayVirtual, String> {

    List<OrderPayVirtual> findByOrderIdAndOrderIdOrderByCreatedTimeDesc(String orderId, String payChannel);

    int countByHash(String hash);

    Optional<OrderPayVirtual> findByOrderId(String orderId);

    List<OrderPayVirtual> findByHashAndPayChannel(String hash, String payChannel);

    int countByHashAndPayChannel(String hash, String payChannel);
}
